package com.example.jdk14;

import java.text.NumberFormat;
import java.util.Currency;
import java.util.Locale;

public class AccountingCurrencyFormatTest {
    public static void main(String[] args) {
        double amount = -3.27;
        Currency currency = Currency.getInstance("USD");
        //Locale usLocale = Locale.US;
        Locale accountingLocale = Locale.forLanguageTag("en-US-u-cf-account");
        NumberFormat formatter = NumberFormat.getCurrencyInstance(accountingLocale);
        formatter.setCurrency(currency);
        String formattedAmount = formatter.format(amount);
        System.out.println(formattedAmount);
    }
}
